Fix: preserve early dispatch for late-wired consumers - #1405
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughEarly-dispatch fanin propagation now accounts for producers that already propagated dispatch state. Wiring seeds late consumers accordingly, scheduler enrollment is centralized and serialized, and tests cover late-wiring and concurrent-propagation cases. ChangesEarly dispatch fanin
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Producer
participant PTO2OrchestratorState
participant PTO2SchedulerState
participant EarlyDispatchQueue
Producer->>PTO2SchedulerState: Propagate published dispatch fanin
PTO2SchedulerState->>PTO2SchedulerState: Claim propagation and snapshot fanout
PTO2OrchestratorState->>PTO2OrchestratorState: Wire consumer and count early producers
PTO2OrchestratorState->>PTO2SchedulerState: Enqueue eligible consumer when fanin is complete
PTO2SchedulerState->>EarlyDispatchQueue: Stage consumer once
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request refactors and improves the early-dispatch scheduling logic by ensuring that late-wired consumers are correctly enqueued when their producers are already fully published. It introduces a helper function try_enqueue_early_dispatch_candidate to centralize the enqueuing logic, optimizes lock contention with an unlocked precheck on dispatch_propagated, and updates the documentation and unit tests accordingly. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
01d6849 to
9635827
Compare
Serialize the dispatch-propagation claim with its fanout snapshot so wiring can distinguish included edges from late edges. Seed late fully-published producers during wiring, enqueue whichever contribution completes dispatch fanin, and cover both serialized and concurrent orderings.
Bring a5 tensormap_and_ringbuffer in line with a2a3 early-dispatch (hw-native-sys#989/hw-native-sys#1079/hw-native-sys#1285/hw-native-sys#1288/hw-native-sys#1297/hw-native-sys#1304/hw-native-sys#1326/hw-native-sys#1329/hw-native-sys#1336/hw-native-sys#1405/hw-native-sys#1340): prepare/publish, src_payload gate + DMB high32 doorbell (sim uses __atomic_load_n ACQUIRE), direct-only eligibility, spare-slot Phase 4b, sync_start early rendezvous, and dep_gen early_dispatch truth. Document the a5 model in RUNTIME_LOGIC §8.6. Add a5 STs: plain early_dispatch plus sync_start early_dispatch and mix_spill ports (EarlyOn/Off) for board validation.
) * feat(a5/tmr): port allow_early_resolve / early-dispatch from a2a3 Bring a5 tensormap_and_ringbuffer in line with a2a3 early-dispatch (#989/#1079/#1285/#1288/#1297/#1304/#1326/#1329/#1336/#1405/#1340): prepare/publish, src_payload gate + DMB high32 doorbell (sim uses __atomic_load_n ACQUIRE), direct-only eligibility, spare-slot Phase 4b, sync_start early rendezvous, and dep_gen early_dispatch truth. Document the a5 model in RUNTIME_LOGIC §8.6. Add a5 STs: plain early_dispatch plus sync_start early_dispatch and mix_spill ports (EarlyOn/Off) for board validation. * test(a5): drop local early-dispatch ST ports from this PR Remove the a5-only early_dispatch / sync_start early ST scenes added for board experiments; keep the runtime port focused for CI. * chore(a5): drop unrelated files that broke pre-commit on the PR Remove accidental local helpers, migrate patches, and the acc_c2v example that were committed with the UT payload-pool fix. Keep the early-dispatch runtime port, a2a3-ported sync_start STs, and a5 UT payload/task pool binding.
Summary
Related Issues